
package com.dave.gd.common.util.threadlocal;



/**
 * 指纹信息
 * 
 *
 */
public class LocalFinger {
	private static final ThreadLocal<LocalFinger> SRC_LOCAL = new ThreadLocal<LocalFinger>() {
		@Override
		protected LocalFinger initialValue() {
			return new LocalFinger();
		}
	};// 发送方指纹信息

	private static final ThreadLocal<LocalFinger> DST_LOCAL = new ThreadLocal<LocalFinger>() {
		@Override
		protected LocalFinger initialValue() {
			return new LocalFinger();
		}
	};// 接收方指纹信息

	/**
	 * 获取发送方指纹信息
	 * 
	 * @return 发送方指纹信息
	 */
	public static LocalFinger getSrcFinger() {
		return SRC_LOCAL.get();
	}

	/**
	 * 获取接收方指纹信息
	 * 
	 * @return 接收方指纹信息
	 */
	public static LocalFinger getDstFinger() {
		return DST_LOCAL.get();
	}

	/**
	 * 设置发送方指纹信息
	 * 
	 * @param srcFinger
	 */
	public static void setSrcFinger(LocalFinger srcFinger) {
		SRC_LOCAL.set(srcFinger);
	}

	/**
	 * 设置接收方指纹信息
	 * 
	 * @param dstFinger
	 */
	public static void setDstFinger(LocalFinger dstFinger) {
		DST_LOCAL.set(dstFinger);
	}

	/**
	 * 清空发送方指纹信息
	 * 
	 */
	public static void removeSrcFinger() {
		SRC_LOCAL.remove();
	}

	/**
	 * 清空接收方指纹信息
	 * 
	 */
	public static void removeDstFinger() {
		DST_LOCAL.remove();
	}

	private String uuId;// 指纹UUID

	private String sid;// SessionId
	private long sendTime;// 发送时间（统一用long时间）
	private long recvTime;// 接收时间（统一用long时间）
	private long respTime;// 响应时间（统一用long时间）

	private String appId;// 应用ID
	private String ip;// IP
	private int port;// 端口
	private String mac;// MAC地址
	private String user;// 操作系统用户

	private long pid;// 进程ID
	private long tid;// 线程ID

	/**
	 * @return the uuId
	 */
	public String getUuId() {
		return uuId;
	}

	/**
	 * @param uuId
	 *            the uuId to set
	 */
	public void setUuId(String uuId) {
		this.uuId = uuId;
	}

	/**
	 * @return the sid
	 */
	public String getSid() {
		return sid;
	}

	/**
	 * @param sid
	 *            the sid to set
	 */
	public void setSid(String sid) {
		this.sid = sid;
	}

	/**
	 * @return the sendTime
	 */
	public long getSendTime() {
		return sendTime;
	}

	/**
	 * @param sendTime
	 *            the sendTime to set
	 */
	public void setSendTime(long sendTime) {
		this.sendTime = sendTime;
	}

	/**
	 * @return the recvTime
	 */
	public long getRecvTime() {
		return recvTime;
	}

	/**
	 * @param recvTime
	 *            the recvTime to set
	 */
	public void setRecvTime(long recvTime) {
		this.recvTime = recvTime;
	}

	/**
	 * @return the respTime
	 */
	public long getRespTime() {
		return respTime;
	}

	/**
	 * @param respTime
	 *            the respTime to set
	 */
	public void setRespTime(long respTime) {
		this.respTime = respTime;
	}

	/**
	 * @return the ip
	 */
	public String getIp() {
		return ip;
	}

	/**
	 * @param ip
	 *            the ip to set
	 */
	public void setIp(String ip) {
		this.ip = ip;
	}

	/**
	 * @return the port
	 */
	public int getPort() {
		return port;
	}

	/**
	 * @param port
	 *            the port to set
	 */
	public void setPort(int port) {
		this.port = port;
	}

	/**
	 * @return the mac
	 */
	public String getMac() {
		return mac;
	}

	/**
	 * @param mac
	 *            the mac to set
	 */
	public void setMac(String mac) {
		this.mac = mac;
	}

	/**
	 * @return the user
	 */
	public String getUser() {
		return user;
	}

	/**
	 * @param user
	 *            the user to set
	 */
	public void setUser(String user) {
		this.user = user;
	}

	/**
	 * @return the pid
	 */
	public long getPid() {
		return pid;
	}

	/**
	 * @param pid
	 *            the pid to set
	 */
	public void setPid(long pid) {
		this.pid = pid;
	}

	/**
	 * @return the tid
	 */
	public long getTid() {
		return tid;
	}

	/**
	 * @param tid
	 *            the tid to set
	 */
	public void setTid(long tid) {
		this.tid = tid;
	}

	/**
	 * @return the appId
	 */
	public String getAppId() {
		return appId;
	}

	/**
	 * @param appId
	 *            the appId to set
	 */
	public void setAppId(String appId) {
		this.appId = appId;
	}

	
	
}
